home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp 2.0.1 (Many Libraries) / Examples / DemoText / UDemoText.inc1.p < prev    next >
Encoding:
Text File  |  1990-10-25  |  2.5 KB  |  96 lines  |  [TEXT/MPS ]

  1. {[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]}
  2.  
  3. { UDemoText.inc1.p }
  4. { Copyright © 1986-1990 by Apple Computer, Inc.  All rights reserved. }
  5.  
  6. VAR
  7.  
  8.     gMenuOfs:            INTEGER;
  9.  
  10.     {******************************************************************************************}
  11.     {  T D e m o T e x t A p p l i c a t i o n    }
  12.     {******************************************************************************************}
  13. {--------------------------------------------------------------------------------------------------}
  14.     {$S AInit}
  15.  
  16. PROCEDURE TDemoTextApplication.IDemoTextApplication;
  17.  
  18.     VAR
  19.         fontName:            Str255;
  20.         aTEView:            TTEView;
  21.  
  22.     BEGIN
  23.  
  24.     IF qNeedsHierarchicalMenus | gConfiguration.hasHierarchicalMenus THEN
  25.         BEGIN
  26.         gMBarDisplayed := kHierDisplayedMBar;
  27.         gMenuOfs := kHierMenuOffset;
  28.         END
  29.     ELSE
  30.         BEGIN
  31.         gMBarDisplayed := kNonHierDisplayedMBar;
  32.         gMenuOfs := 0;
  33.         END;
  34.  
  35.     IApplication(kFileType);
  36.  
  37.     IF NOT gFinderPrinting THEN
  38.         BEGIN
  39.         AddResMenu(GetMHandle(mFont), 'FONT');
  40.  
  41.         gStaggerCount := 0;
  42.  
  43.         SetStyle(cBold, [bold]);
  44.         SetStyle(cUnderline, [underline]);
  45.         SetStyle(cItalic, [italic]);
  46.         SetStyle(cOutline, [outline]);
  47.         SetStyle(cShadow, [shadow]);
  48.         SetStyle(cCondense, [condense]);
  49.         SetStyle(cExtend, [extend]);
  50.         END;
  51.  
  52.     { Instead of hard-wiring a default text style, get it from the TEView resource    }
  53.     aTEView := TTEView(DoCreateViews(NIL, NIL, kViewRsrcID, gZeroVPt));
  54.     FailNIL(aTEView);
  55.     GetFontName(aTEView.fTextStyle.tsFont, fontName);
  56.     WITH gDefaultSpecs, aTEView DO                        { Set up initial text specs }
  57.         BEGIN
  58.         theTextFont := fontName;
  59.         theTextFace := fTextStyle.tsFace;
  60.         theTextSize := fTextStyle.tsSize;
  61.         theTextColor := fTextStyle.tsColor;
  62.         theJustification := fJustification;
  63.         theBackColor := gRGBWhite;
  64.         END;
  65.     FreeIfObject(aTEView);
  66.     aTEView := NIL;
  67.     END;
  68.  
  69. {--------------------------------------------------------------------------------------------------}
  70. {$S AOpen}
  71.  
  72. FUNCTION TDemoTextApplication.DoMakeDocument(itsCmdNumber: CmdNumber): TDocument; OVERRIDE;
  73.  
  74.     VAR
  75.         aTEDocument:        TTEDocument;
  76.  
  77.     BEGIN
  78.     New(aTEDocument);
  79.     FailNIL(aTEDocument);
  80.     aTEDocument.ITEDocument(kFileType, kSignature, kUsesDataFork, kUsesRsrcFork, NOT kDataOpen,
  81.                             NOT kRsrcOpen); ;
  82.     DoMakeDocument := aTEDocument;
  83.     END;
  84.  
  85. {--------------------------------------------------------------------------------------------------}
  86. {$IFC qDebug}
  87. {$S ADebug}
  88.  
  89. PROCEDURE TDemoTextApplication.IdentifySoftware;
  90.  
  91.     BEGIN
  92.     WriteLn('DemoText Source date: 23 April 86; Compiled: ', COMPDATE, ' @ ', COMPTIME);
  93.     INHERITED IdentifySoftware;
  94.     END;
  95. {$ENDC}
  96.